package com.luxk.db.errorcode;

public enum ErrorCodeCache implements ErrorCode {
	
	ERROR_DATA_BLOCK_CHECKSUM(0,
			"Block {0} checksum {1} mismatched",
			"The data block is inconsistent",
			"Media recovery required");
	
	private final int codeOffset = 1000;
	private final int code;
	private final String desc;
	private final String cause;
	private final String action;
	
	private ErrorCodeCache(int id, String desc, String cause, String action) {
		this.code = this.codeOffset + id;
		this.desc = desc;
		this.cause = cause;
		this.action = action;
	}

	public int getCode() { return this.code; }
	public String getDesc() { return this.desc; }
	public String getCause() { return this.cause; }
	public String getAction() { return this.action; }
	public String toString() {
		return String.format("ERROR-%05d %s", this.code, this.desc);
	}
}
